﻿using System;
//using UnityEngine;

namespace FrameWork
{
	#region  Global delegate
    /// <summary>
    /// 定义全局委托
    /// 当前状态改变的UI对象
    /// </summary>
    /// <param name="obj"></param>
    /// <param name="newState"></param>
    /// <param name="oldState"></param>
	public delegate void StateChangeEvent(Object obj,EnumObjectState newState,EnumObjectState oldState);

    public delegate void MessageEvent(Message message);

    public delegate void OnTouchEventHandle(EventTriggerListener _listener,object _args, params object[] _params);

	#endregion
    
	#region 全局枚举对象
    /// <summary>
    /// UI状态
    /// </summary>
    public enum EnumObjectState
    {
        None,
        Init,
        loading,
        Ready,
        Disabled,
        Closeing
    }

    /// <summary>
    /// UI类型（根据UI类型加载UI）
    /// </summary>
    public enum EnumUIType : int
    {
        None = -1,
        TestOne = 0,
        TestTwo = 1,
        Test
    }

    public enum EnumTouchEventType
    {
        OnClick,
        OnDoubleClick,
        OnDown,
        OnUp,
        OnEnter,
        OnExit,
        OnSelect,
        OnUpdateSelect,
        OnDeSelect,
        OnDrag,
        OnDragEnd,
        OnDrop,
        OnScroll,
        OnMove,
        OnLongPress,

    }

    #endregion

    public class UIPathDefines
    {
        public const string UI_PREFAB = "Prefabs/";
        public const string UI_CONTROLS_PREFAB = "UIPrefab/Control/";
        public const string UI_SUBUI_PREFAB = "UIPrefab/SubUI/";
        public const string UI_ICON_PATH = "UI/Icon";

        public static string GetPrefabsPathByType(EnumUIType _uiType)
        {
            string _path = string.Empty;
            switch(_uiType)
            {
                case EnumUIType.TestOne:
                    {
                        _path = UI_PREFAB + "TestOne";
                    }
                    break;
                case EnumUIType.TestTwo:
                    {
                        _path = UI_PREFAB + "TestTwo";
                    }
                    break;
                default:
                    UnityEngine.Debug.Log("Not Find EnumUIType!  type:"+_uiType.ToString());
                    break;
            }

            return _path;
        }

        public static System.Type GetUIScriptByType(EnumUIType _uiType)
        {
            System.Type _scriptType = null;
            switch(_uiType)
            {
                case EnumUIType.TestOne:
                    {

                        _scriptType = typeof(TestOne);
                    }
                    break;
                case EnumUIType.TestTwo:
                    {
                        _scriptType = typeof(TestTwo);
                    }
                    break;
                case EnumUIType.Test:
                    {

                    }
                    break;
                default:
                    UnityEngine.Debug.LogError("not find enumUiType ! type:" + _uiType.ToString());
                    break;
            }
            return _scriptType;
        }

    }

    public class Defines
    {
        public Defines()
        {

        }
    }
}
